"docopt 0.6.0 (git+https://github.com/burntsushi/docopt.rs#fc7ba2f1a5a351f7874257d880223d2ff5c75d36)",
"docopt_macros 0.6.0 (git+https://github.com/burntsushi/docopt.rs#fc7ba2f1a5a351f7874257d880223d2ff5c75d36)",
"flate2 0.0.1 (git+https://github.com/alexcrichton/flate2-rs#12593d1b9ccf09c2eabac176a6e233b171eed843)",
- "git2 0.0.1 (git+https://github.com/alexcrichton/git2-rs#079938f9f2e376a95df96b13fa162573c2d1d568)",
+ "git2 0.0.1 (git+https://github.com/alexcrichton/git2-rs#5d67a5ffda44569a5d016e8bc3aae7e57e6ca7f1)",
"hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git#f0fd1546b0a7a278a12658ab8602b5c827cc3a42)",
"semver 0.0.1 (git+https://github.com/rust-lang/semver#c78b40d7fdf8acd99b503e6ce394fbcf9eb8982f)",
"tar 0.0.1 (git+https://github.com/alexcrichton/tar-rs#689bbc003ae47feae5bc99c53b56736e4ad994ba)",
[[package]]
name = "git2"
version = "0.0.1"
-source = "git+https://github.com/alexcrichton/git2-rs#079938f9f2e376a95df96b13fa162573c2d1d568"
+source = "git+https://github.com/alexcrichton/git2-rs#5d67a5ffda44569a5d016e8bc3aae7e57e6ca7f1"
dependencies = [
- "libgit2 0.0.1 (git+https://github.com/alexcrichton/git2-rs#079938f9f2e376a95df96b13fa162573c2d1d568)",
+ "libgit2 0.0.1 (git+https://github.com/alexcrichton/git2-rs#5d67a5ffda44569a5d016e8bc3aae7e57e6ca7f1)",
]
[[package]]
[[package]]
name = "libgit2"
version = "0.0.1"
-source = "git+https://github.com/alexcrichton/git2-rs#079938f9f2e376a95df96b13fa162573c2d1d568"
+source = "git+https://github.com/alexcrichton/git2-rs#5d67a5ffda44569a5d016e8bc3aae7e57e6ca7f1"
dependencies = [
"link-config 0.0.1 (git+https://github.com/alexcrichton/link-config#f08103ea7d2e2d3369c2c5e66b0220c8d16b92c9)",
]
let repo = try!(GitCheckout::clone_repo(database.get_path(), into));
let checkout = GitCheckout::new(into, database, revision, repo);
- try!(checkout.reset());
- try!(checkout.update_submodules());
+ try!(checkout.reset().chain_error(|| {
+ internal("failed to reset to the right revision")
+ }));
+ try!(checkout.update_submodules().chain_error(|| {
+ internal("failed to update submodules")
+ }));
Ok(checkout)
}
for mut child in try!(repo.submodules()).move_iter() {
try!(child.init(false));
+ let url = try!(child.url().require(|| {
+ internal("non-utf8 url for submodule")
+ }));
// A submodule which is listed in .gitmodules but not actually
// checked out will not have a head id, so we should ignore it.
}
Err(..) => {
let path = repo.path().dir_path().join(child.path());
- let url = try!(child.url().require(|| {
- internal("invalid submodule url")
- }));
try!(git2::Repository::clone(url, &path))
}
};
// Fetch data from origin and reset to the head commit
- let url = try!(child.url().require(|| {
- internal("repo with non-utf8 url")
- }));
let refspec = "refs/heads/*:refs/heads/*";
let mut remote = try!(repo.remote_create_anonymous(url, refspec));
- try!(remote.fetch(sig, None));
+ try!(remote.fetch(sig, None).chain_error(|| {
+ internal(format!("failed to fetch submodule `{}` from {}",
+ child.name().unwrap_or(""), url))
+ }));
let obj = try!(git2::Object::lookup(&repo, head, None));
try!(repo.reset(&obj, git2::Hard, sig, None));
doctest = DOCTEST,
dir = p.url()).as_slice()));
p.root().move_into_the_past().assert();
- assert_that(p.process(cargo_dir().join("cargo")).arg("bench"),
+ assert_that(p.process(cargo_dir().join("cargo")).arg("bench").arg("-v"),
execs().with_status(0)
.with_stdout(format!("\
+{running} [..]
+{running} [..]
+{running} [..]
+{running} [..]
{fresh} bar v0.0.1 ({dir})
{fresh} foo v0.0.1 ({dir})
-{running} target[..]release[..]bench-[..]
+{running} [..]target[..]release[..]bench-[..]
running 1 test
test foo ... bench: 0 ns/iter (+/- 0)
test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured
-{running} target[..]release[..]foo-[..]
+{running} [..]target[..]release[..]foo-[..]
running 1 test
test foo ... bench: 0 ns/iter (+/- 0)
test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured
{doctest} foo
+{running} [..]
running 0 tests
}).assert();
git_project.process("git").args(["submodule", "add"])
- .arg(git_project2.root()).arg("src").exec_with_output().assert();
+ .arg(git_project2.url().to_string()).arg("src").exec_with_output()
+ .assert();
git_project.process("git").args(["add", "."]).exec_with_output().assert();
git_project.process("git").args(["commit", "-m", "test"]).exec_with_output()
.assert();
pub fn main() { println!(\"{}\", dep1::dep()) }
");
+ println!("first run");
assert_that(project.cargo_process("run"), execs()
.with_stdout(format!("{} git repository `[..]`\n\
{} dep1 v0.5.0 ([..])\n\
timer::sleep(Duration::milliseconds(1000));
// Update the dependency and carry on!
- assert_that(project.process(cargo_dir().join("cargo")).arg("update"), execs()
+ println!("update");
+ assert_that(project.process(cargo_dir().join("cargo")).arg("update").arg("-v"),
+ execs()
.with_stderr("")
.with_stdout(format!("{} git repository `{}`",
UPDATING,
git_project.url())));
- assert_that(project.cargo_process("run"), execs()
- .with_stdout(format!("{} git repository `[..]`\n\
- {} dep1 v0.5.0 ([..])\n\
- {} foo v0.5.0 ([..])\n\
- {} `target[..]foo`\n\
+ println!("last run");
+ assert_that(project.process(cargo_dir().join("cargo")).arg("run"), execs()
+ .with_stdout(format!("{compiling} dep1 v0.5.0 ([..])\n\
+ {compiling} foo v0.5.0 ([..])\n\
+ {running} `target[..]foo`\n\
project3\
",
- UPDATING,
- COMPILING,
- COMPILING,
- RUNNING))
+ compiling = COMPILING, running = RUNNING))
.with_stderr("")
.with_status(0));
})